~ chicken-core (chicken-5) /manual/Module (chicken repl)
Trap1[[tags: manual]]2[[toc:]]34== Module (chicken repl)56This module provides procedures you can use to create your own7Read-Eval-Print Loop (REPL).89=== repl1011<procedure>(repl [EVALUATOR])</procedure>1213Start a new read-eval-print loop. Sets the {{reset-handler}} so that14any invocation of {{reset}} restarts the read-eval-print loop. Also15changes the current exception-handler to display a message, write16any arguments to the value of {{(current-error-port)}} and reset.1718If {{EVALUATOR}} is given, it should be a procedure of one argument that19is used in place of {{eval}} to evaluate each entered expression.2021You can use {{quit}} to terminate the current read-eval-print loop.22Encountering end-of-file also terminates the current REPL.232425=== repl-prompt2627<parameter>(repl-prompt)</parameter>2829A procedure that should evaluate to a string that will be printed before30reading interactive input from the user in a read-eval-print loop.31Defaults to {{(lambda () "#;N> ")}}.323334=== quit3536<procedure>(quit [RESULT])</procedure>3738In the interpreter {{quit}} exits the currently active read-eval-print39loop. In compiled code, it is equivalent to calling {{exit}}. See40also the {{repl}} procedure.414243=== reset4445<procedure>(reset)</procedure>4647Reset program (Invokes {{reset-handler}}).484950=== reset-handler5152<parameter>(reset-handler)</parameter>5354A procedure of zero arguments that is called via {{reset}}. The55default behavior in compiled code is to invoke the value of56{{(exit-handler)}}. The default behavior in the interpreter is to57abort the current computation and to restart the read-eval-print loop.5859---60Previous: [[Module (chicken read-syntax)]]6162Next: [[Module (chicken sort)]]